home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 March / PCWMAR09.iso / Software / Freeware / NSIS 2.41 / nsis-2.41-setup.exe / Examples / makensis.nsi < prev    next >
Encoding:
NSIS script  |  2008-06-12  |  31.8 KB  |  1,035 lines

  1. ;NSIS Setup Script
  2. ;--------------------------------
  3.  
  4. !ifndef VERSION
  5.   !define VERSION 'anonymous-build'
  6. !endif
  7.  
  8. ;--------------------------------
  9. ;Configuration
  10.  
  11. !ifdef OUTFILE
  12.   OutFile "${OUTFILE}"
  13. !else
  14.   OutFile ..\nsis-${VERSION}-setup.exe
  15. !endif
  16.  
  17. SetCompressor /SOLID lzma
  18.  
  19. InstType "Full"
  20. InstType "Lite"
  21. InstType "Minimal"
  22.  
  23. InstallDir $PROGRAMFILES\NSIS
  24. InstallDirRegKey HKLM Software\NSIS ""
  25.  
  26. RequestExecutionLevel admin
  27.  
  28. ;--------------------------------
  29. ;Header Files
  30.  
  31. !include "MUI2.nsh"
  32. !include "Sections.nsh"
  33. !include "LogicLib.nsh"
  34. !include "Memento.nsh"
  35. !include "WordFunc.nsh"
  36.  
  37. ;--------------------------------
  38. ;Functions
  39.  
  40. !ifdef VER_MAJOR & VER_MINOR & VER_REVISION & VER_BUILD
  41.  
  42.   !insertmacro VersionCompare
  43.  
  44. !endif
  45.  
  46. ;--------------------------------
  47. ;Definitions
  48.  
  49. !define SHCNE_ASSOCCHANGED 0x8000000
  50. !define SHCNF_IDLIST 0
  51.  
  52. ;--------------------------------
  53. ;Configuration
  54.  
  55. ;Names
  56. Name "NSIS"
  57. Caption "NSIS ${VERSION} Setup"
  58.  
  59. ;Memento Settings
  60. !define MEMENTO_REGISTRY_ROOT HKLM
  61. !define MEMENTO_REGISTRY_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\NSIS"
  62.  
  63. ;Interface Settings
  64. !define MUI_ABORTWARNING
  65.  
  66. !define MUI_HEADERIMAGE
  67. !define MUI_WELCOMEFINISHPAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Wizard\nsis.bmp"
  68.  
  69. !define MUI_COMPONENTSPAGE_SMALLDESC
  70.  
  71. ;Pages
  72. !define MUI_WELCOMEPAGE_TITLE "Welcome to the NSIS ${VERSION} Setup Wizard"
  73. !define MUI_WELCOMEPAGE_TEXT "This wizard will guide you through the installation of NSIS (Nullsoft Scriptable Install System) ${VERSION}, the next generation of the Windows installer and uninstaller system that doesn't suck and isn't huge.$\r$\n$\r$\nNSIS 2 includes a new Modern User Interface, LZMA compression, support for multiple languages and an easy plug-in system.$\r$\n$\r$\n$_CLICK"
  74.  
  75. !insertmacro MUI_PAGE_WELCOME
  76. !insertmacro MUI_PAGE_LICENSE "..\COPYING"
  77. !ifdef VER_MAJOR & VER_MINOR & VER_REVISION & VER_BUILD
  78. Page custom PageReinstall PageLeaveReinstall
  79. !endif
  80. !insertmacro MUI_PAGE_COMPONENTS
  81. !insertmacro MUI_PAGE_DIRECTORY
  82. !insertmacro MUI_PAGE_INSTFILES
  83.  
  84. !define MUI_FINISHPAGE_LINK "Visit the NSIS site for the latest news, FAQs and support"
  85. !define MUI_FINISHPAGE_LINK_LOCATION "http://nsis.sf.net/"
  86.  
  87. !define MUI_FINISHPAGE_RUN "$INSTDIR\NSIS.exe"
  88. !define MUI_FINISHPAGE_NOREBOOTSUPPORT
  89.  
  90. !define MUI_FINISHPAGE_SHOWREADME
  91. !define MUI_FINISHPAGE_SHOWREADME_TEXT "Show release notes"
  92. !define MUI_FINISHPAGE_SHOWREADME_FUNCTION ShowReleaseNotes
  93.  
  94. !insertmacro MUI_PAGE_FINISH
  95.  
  96. !insertmacro MUI_UNPAGE_CONFIRM
  97. !insertmacro MUI_UNPAGE_INSTFILES
  98.  
  99. ;--------------------------------
  100. ;Languages
  101.  
  102. !insertmacro MUI_LANGUAGE "English"
  103.  
  104. ;--------------------------------
  105. ;Installer Sections
  106.  
  107. ${MementoSection} "NSIS Core Files (required)" SecCore
  108.  
  109.   SetDetailsPrint textonly
  110.   DetailPrint "Installing NSIS Core Files..."
  111.   SetDetailsPrint listonly
  112.  
  113.   SectionIn 1 2 3 RO
  114.   SetOutPath $INSTDIR
  115.   RMDir /r $SMPROGRAMS\NSIS
  116.  
  117.   SetOverwrite on
  118.   File ..\makensis.exe
  119.   File ..\makensisw.exe
  120.   File ..\COPYING
  121.   File ..\NSIS.chm
  122.   File ..\NSIS.exe
  123.   File /nonfatal ..\NSIS.exe.manifest
  124.  
  125.   IfFileExists $INSTDIR\nsisconf.nsi "" +2
  126.   Rename $INSTDIR\nsisconf.nsi $INSTDIR\nsisconf.nsh
  127.   SetOverwrite off
  128.   File ..\nsisconf.nsh
  129.   SetOverwrite on
  130.  
  131.   SetOutPath $INSTDIR\Stubs
  132.   File ..\Stubs\bzip2
  133.   File ..\Stubs\bzip2_solid
  134.   File ..\Stubs\lzma
  135.   File ..\Stubs\lzma_solid
  136.   File ..\Stubs\zlib
  137.   File ..\Stubs\zlib_solid
  138.   File ..\Stubs\uninst
  139.  
  140.   SetOutPath $INSTDIR\Include
  141.   File ..\Include\WinMessages.nsh
  142.   File ..\Include\Sections.nsh
  143.   File ..\Include\Library.nsh
  144.   File ..\Include\UpgradeDLL.nsh
  145.   File ..\Include\LogicLib.nsh
  146.   File ..\Include\StrFunc.nsh
  147.   File ..\Include\Colors.nsh
  148.   File ..\Include\FileFunc.nsh
  149.   File ..\Include\TextFunc.nsh
  150.   File ..\Include\WordFunc.nsh
  151.   File ..\Include\WinVer.nsh
  152.   File ..\Include\x64.nsh
  153.   File ..\Include\Memento.nsh
  154.   File ..\Include\LangFile.nsh
  155.   File ..\Include\InstallOptions.nsh
  156.   File ..\Include\MultiUser.nsh
  157.   File ..\Include\VB6RunTime.nsh
  158.  
  159.   SetOutPath $INSTDIR\Docs\StrFunc
  160.   File ..\Docs\StrFunc\StrFunc.txt
  161.  
  162.   SetOutPath $INSTDIR\Docs\MultiUser
  163.   File ..\Docs\MultiUser\Readme.html
  164.  
  165.   SetOutPath $INSTDIR\Docs\makensisw
  166.   File ..\Docs\makensisw\*.txt
  167.  
  168.   SetOutPath $INSTDIR\Menu
  169.   File ..\Menu\*.html
  170.   SetOutPath $INSTDIR\Menu\images
  171.   File ..\Menu\images\header.gif
  172.   File ..\Menu\images\line.gif
  173.   File ..\Menu\images\site.gif
  174.  
  175.   Delete $INSTDIR\makensis.htm
  176.   Delete $INSTDIR\Docs\*.html
  177.   Delete $INSTDIR\Docs\style.css
  178.   RMDir $INSTDIR\Docs
  179.  
  180.   SetOutPath $INSTDIR\Bin
  181.   File ..\Bin\LibraryLocal.exe
  182.   File ..\Bin\RegTool.bin
  183.  
  184.   SetOutPath $INSTDIR\Plugins
  185.   File ..\Plugins\TypeLib.dll
  186.  
  187.   ReadRegStr $R0 HKCR ".nsi" ""
  188.   StrCmp $R0 "NSISFile" 0 +2
  189.     DeleteRegKey HKCR "NSISFile"
  190.  
  191.   WriteRegStr HKCR ".nsi" "" "NSIS.Script"
  192.   WriteRegStr HKCR "NSIS.Script" "" "NSIS Script File"
  193.   WriteRegStr HKCR "NSIS.Script\DefaultIcon" "" "$INSTDIR\makensisw.exe,1"
  194.   ReadRegStr $R0 HKCR "NSIS.Script\shell\open\command" ""
  195.   StrCmp $R0 "" 0 no_nsiopen
  196.     WriteRegStr HKCR "NSIS.Script\shell" "" "open"
  197.     WriteRegStr HKCR "NSIS.Script\shell\open\command" "" 'notepad.exe "%1"'
  198.   no_nsiopen:
  199.   WriteRegStr HKCR "NSIS.Script\shell\compile" "" "Compile NSIS Script"
  200.   WriteRegStr HKCR "NSIS.Script\shell\compile\command" "" '"$INSTDIR\makensisw.exe" "%1"'
  201.   WriteRegStr HKCR "NSIS.Script\shell\compile-compressor" "" "Compile NSIS Script (Choose Compressor)"
  202.   WriteRegStr HKCR "NSIS.Script\shell\compile-compressor\command" "" '"$INSTDIR\makensisw.exe" /ChooseCompressor "%1"'
  203.  
  204.   ReadRegStr $R0 HKCR ".nsh" ""
  205.   StrCmp $R0 "NSHFile" 0 +2
  206.     DeleteRegKey HKCR "NSHFile"
  207.  
  208.   WriteRegStr HKCR ".nsh" "" "NSIS.Header"
  209.   WriteRegStr HKCR "NSIS.Header" "" "NSIS Header File"
  210.   WriteRegStr HKCR "NSIS.Header\DefaultIcon" "" "$INSTDIR\makensisw.exe,1"
  211.   ReadRegStr $R0 HKCR "NSIS.Header\shell\open\command" ""
  212.   StrCmp $R0 "" 0 no_nshopen
  213.     WriteRegStr HKCR "NSIS.Header\shell" "" "open"
  214.     WriteRegStr HKCR "NSIS.Header\shell\open\command" "" 'notepad.exe "%1"'
  215.   no_nshopen:
  216.  
  217.   System::Call 'Shell32::SHChangeNotify(i ${SHCNE_ASSOCCHANGED}, i ${SHCNF_IDLIST}, i 0, i 0)'
  218.  
  219. ${MementoSectionEnd}
  220.  
  221. ${MementoSection} "Script Examples" SecExample
  222.  
  223.   SetDetailsPrint textonly
  224.   DetailPrint "Installing Script Examples..."
  225.   SetDetailsPrint listonly
  226.  
  227.   SectionIn 1 2
  228.   SetOutPath $INSTDIR\Examples
  229.   File ..\Examples\makensis.nsi
  230.   File ..\Examples\example1.nsi
  231.   File ..\Examples\example2.nsi
  232.   File ..\Examples\viewhtml.nsi
  233.   File ..\Examples\waplugin.nsi
  234.   File ..\Examples\bigtest.nsi
  235.   File ..\Examples\primes.nsi
  236.   File ..\Examples\rtest.nsi
  237.   File ..\Examples\gfx.nsi
  238.   File ..\Examples\one-section.nsi
  239.   File ..\Examples\languages.nsi
  240.   File ..\Examples\Library.nsi
  241.   File ..\Examples\VersionInfo.nsi
  242.   File ..\Examples\UserVars.nsi
  243.   File ..\Examples\LogicLib.nsi
  244.   File ..\Examples\silent.nsi
  245.   File ..\Examples\StrFunc.nsi
  246.   File ..\Examples\FileFunc.nsi
  247.   File ..\Examples\FileFunc.ini
  248.   File ..\Examples\FileFuncTest.nsi
  249.   File ..\Examples\TextFunc.nsi
  250.   File ..\Examples\TextFunc.ini
  251.   File ..\Examples\TextFuncTest.nsi
  252.   File ..\Examples\WordFunc.nsi
  253.   File ..\Examples\WordFunc.ini
  254.   File ..\Examples\WordFuncTest.nsi
  255.   File ..\Examples\Memento.nsi
  256.  
  257.   SetOutPath $INSTDIR\Examples\Plugin
  258.   File ..\Examples\Plugin\exdll.c
  259.   File ..\Examples\Plugin\exdll.dpr
  260.   File ..\Examples\Plugin\exdll.dsp
  261.   File ..\Examples\Plugin\exdll.dsw
  262.   File ..\Examples\Plugin\exdll.h
  263.   File ..\Examples\Plugin\exdll_with_unit.dpr
  264.   File ..\Examples\Plugin\extdll.inc
  265.   File ..\Examples\Plugin\nsis.pas
  266.  
  267. ${MementoSectionEnd}
  268.  
  269. !ifndef NO_STARTMENUSHORTCUTS
  270. ${MementoSection} "Start Menu and Desktop Shortcuts" SecShortcuts
  271.  
  272.   SetDetailsPrint textonly
  273.   DetailPrint "Installing Start Menu and Desktop Shortcuts..."
  274.   SetDetailsPrint listonly
  275.  
  276. !else
  277. ${MementoSection} "Desktop Shortcut" SecShortcuts
  278.  
  279.   SetDetailsPrint textonly
  280.   DetailPrint "Installing Desktop Shortcut..."
  281.   SetDetailsPrint listonly
  282.  
  283. !endif
  284.   SectionIn 1 2
  285.   SetOutPath $INSTDIR
  286. !ifndef NO_STARTMENUSHORTCUTS
  287.   CreateShortCut "$SMPROGRAMS\NSIS.lnk" "$INSTDIR\NSIS.exe"
  288. !endif
  289.  
  290.   CreateShortCut "$DESKTOP\NSIS.lnk" "$INSTDIR\NSIS.exe"
  291.  
  292. ${MementoSectionEnd}
  293.  
  294. SectionGroup "User Interfaces" SecInterfaces
  295.  
  296. ${MementoSection} "Modern User Interface" SecInterfacesModernUI
  297.  
  298.   SetDetailsPrint textonly
  299.   DetailPrint "Installing User Interfaces | Modern User Interface..."
  300.   SetDetailsPrint listonly
  301.  
  302.   SectionIn 1 2
  303.  
  304.   SetOutPath "$INSTDIR\Examples\Modern UI"
  305.   File "..\Examples\Modern UI\Basic.nsi"
  306.   File "..\Examples\Modern UI\HeaderBitmap.nsi"
  307.   File "..\Examples\Modern UI\MultiLanguage.nsi"
  308.   File "..\Examples\Modern UI\StartMenu.nsi"
  309.   File "..\Examples\Modern UI\WelcomeFinish.nsi"
  310.  
  311.   SetOutPath "$INSTDIR\Contrib\Modern UI"
  312.   File "..\Contrib\Modern UI\System.nsh"
  313.   File "..\Contrib\Modern UI\ioSpecial.ini"
  314.  
  315.   SetOutPath "$INSTDIR\Docs\Modern UI"
  316.   File "..\Docs\Modern UI\Readme.html"
  317.   File "..\Docs\Modern UI\Changelog.txt"
  318.   File "..\Docs\Modern UI\License.txt"
  319.  
  320.   SetOutPath "$INSTDIR\Docs\Modern UI\images"
  321.   File "..\Docs\Modern UI\images\header.gif"
  322.   File "..\Docs\Modern UI\images\screen1.png"
  323.   File "..\Docs\Modern UI\images\screen2.png"
  324.   File "..\Docs\Modern UI\images\open.gif"
  325.   File "..\Docs\Modern UI\images\closed.gif"
  326.  
  327.   SetOutPath $INSTDIR\Contrib\UIs
  328.   File "..\Contrib\UIs\modern.exe"
  329.   File "..\Contrib\UIs\modern_headerbmp.exe"
  330.   File "..\Contrib\UIs\modern_headerbmpr.exe"
  331.   File "..\Contrib\UIs\modern_nodesc.exe"
  332.   File "..\Contrib\UIs\modern_smalldesc.exe"
  333.  
  334.   SetOutPath $INSTDIR\Include
  335.   File "..\Include\MUI.nsh"
  336.  
  337.   SetOutPath "$INSTDIR\Contrib\Modern UI 2"
  338.   File "..\Contrib\Modern UI 2\Deprecated.nsh"
  339.   File "..\Contrib\Modern UI 2\Interface.nsh"
  340.   File "..\Contrib\Modern UI 2\Localization.nsh"
  341.   File "..\Contrib\Modern UI 2\MUI2.nsh"
  342.   File "..\Contrib\Modern UI 2\Pages.nsh"
  343.  
  344.   SetOutPath "$INSTDIR\Contrib\Modern UI 2\Pages"
  345.   File "..\Contrib\Modern UI 2\Pages\Components.nsh"
  346.   File "..\Contrib\Modern UI 2\Pages\Directory.nsh"
  347.   File "..\Contrib\Modern UI 2\Pages\Finish.nsh"
  348.   File "..\Contrib\Modern UI 2\Pages\InstallFiles.nsh"
  349.   File "..\Contrib\Modern UI 2\Pages\License.nsh"
  350.   File "..\Contrib\Modern UI 2\Pages\StartMenu.nsh"
  351.   File "..\Contrib\Modern UI 2\Pages\UninstallConfirm.nsh"
  352.   File "..\Contrib\Modern UI 2\Pages\Welcome.nsh"
  353.  
  354.   SetOutPath "$INSTDIR\Docs\Modern UI 2"
  355.   File "..\Docs\Modern UI 2\Readme.html"
  356.   File "..\Docs\Modern UI 2\License.txt"
  357.  
  358.   SetOutPath "$INSTDIR\Docs\Modern UI 2\images"
  359.   File "..\Docs\Modern UI 2\images\header.gif"
  360.   File "..\Docs\Modern UI 2\images\screen1.png"
  361.   File "..\Docs\Modern UI 2\images\screen2.png"
  362.   File "..\Docs\Modern UI 2\images\open.gif"
  363.   File "..\Docs\Modern UI 2\images\closed.gif"
  364.  
  365.   SetOutPath $INSTDIR\Include
  366.   File "..\Include\MUI2.nsh"
  367.  
  368. ${MementoSectionEnd}
  369.  
  370. ${MementoSection} "Default User Interface" SecInterfacesDefaultUI
  371.  
  372.   SetDetailsPrint textonly
  373.   DetailPrint "Installing User Interfaces | Default User Interface..."
  374.   SetDetailsPrint listonly
  375.  
  376.   SectionIn 1
  377.  
  378.   SetOutPath "$INSTDIR\Contrib\UIs"
  379.   File "..\Contrib\UIs\default.exe"
  380.  
  381. ${MementoSectionEnd}
  382.  
  383. ${MementoSection} "Tiny User Interface" SecInterfacesTinyUI
  384.  
  385.   SetDetailsPrint textonly
  386.   DetailPrint "Installing User Interfaces | Tiny User Interface..."
  387.   SetDetailsPrint listonly
  388.  
  389.   SectionIn 1
  390.  
  391.   SetOutPath "$INSTDIR\Contrib\UIs"
  392.   File "..\Contrib\UIs\sdbarker_tiny.exe"
  393.  
  394. ${MementoSectionEnd}
  395.  
  396. SectionGroupEnd
  397.  
  398. ${MementoSection} "Graphics" SecGraphics
  399.  
  400.   SetDetailsPrint textonly
  401.   DetailPrint "Installing Graphics..."
  402.   SetDetailsPrint listonly
  403.  
  404.   SectionIn 1
  405.  
  406.   Delete $INSTDIR\Contrib\Icons\*.ico
  407.   Delete $INSTDIR\Contrib\Icons\*.bmp
  408.   RMDir $INSTDIR\Contrib\Icons
  409.   SetOutPath $INSTDIR\Contrib\Graphics
  410.   File /r "..\Contrib\Graphics\*.ico"
  411.   File /r "..\Contrib\Graphics\*.bmp"
  412. ${MementoSectionEnd}
  413.  
  414. ${MementoSection} "Language Files" SecLangFiles
  415.  
  416.   SetDetailsPrint textonly
  417.   DetailPrint "Installing Language Files..."
  418.   SetDetailsPrint listonly
  419.  
  420.   SectionIn 1
  421.  
  422.   SetOutPath "$INSTDIR\Contrib\Language files"
  423.   File "..\Contrib\Language files\*.nlf"
  424.  
  425.   SetOutPath $INSTDIR\Bin
  426.   File ..\Bin\MakeLangID.exe
  427.  
  428.   !insertmacro SectionFlagIsSet ${SecInterfacesModernUI} ${SF_SELECTED} mui nomui
  429.   mui:
  430.     SetOutPath "$INSTDIR\Contrib\Language files"
  431.     File "..\Contrib\Language files\*.nsh"
  432.   nomui:
  433.  
  434. ${MementoSectionEnd}
  435.  
  436. SectionGroup "Tools" SecTools
  437.  
  438. ${MementoSection} "Zip2Exe" SecToolsZ2E
  439.  
  440.   SetDetailsPrint textonly
  441.   DetailPrint "Installing Tools | Zip2Exe..."
  442.   SetDetailsPrint listonly
  443.  
  444.   SectionIn 1
  445.  
  446.   SetOutPath $INSTDIR\Bin
  447.   File ..\Bin\zip2exe.exe
  448.   SetOutPath $INSTDIR\Contrib\zip2exe
  449.   File ..\Contrib\zip2exe\Base.nsh
  450.   File ..\Contrib\zip2exe\Modern.nsh
  451.   File ..\Contrib\zip2exe\Classic.nsh
  452.  
  453. ${MementoSectionEnd}
  454.  
  455. SectionGroupEnd
  456.  
  457. SectionGroup "Plug-ins" SecPluginsPlugins
  458.  
  459. ${MementoSection} "Banner" SecPluginsBanner
  460.  
  461.   SetDetailsPrint textonly
  462.   DetailPrint "Installing Plug-ins | Banner..."
  463.   SetDetailsPrint listonly
  464.  
  465.   SectionIn 1
  466.  
  467.   SetOutPath $INSTDIR\Plugins
  468.   File ..\Plugins\Banner.dll
  469.   SetOutPath $INSTDIR\Docs\Banner
  470.   File ..\Docs\Banner\Readme.txt
  471.   SetOutPath $INSTDIR\Examples\Banner
  472.   File ..\Examples\Banner\Example.nsi
  473. ${MementoSectionEnd}
  474.  
  475. ${MementoSection} "Language DLL" SecPluginsLangDLL
  476.  
  477.   SetDetailsPrint textonly
  478.   DetailPrint "Installing Plug-ins | Language DLL..."
  479.   SetDetailsPrint listonly
  480.  
  481.   SectionIn 1
  482.   SetOutPath $INSTDIR\Plugins
  483.   File ..\Plugins\LangDLL.dll
  484. ${MementoSectionEnd}
  485.  
  486. ${MementoSection} "nsExec" SecPluginsnsExec
  487.  
  488.   SetDetailsPrint textonly
  489.   DetailPrint "Installing Plug-ins | nsExec..."
  490.   SetDetailsPrint listonly
  491.  
  492.   SectionIn 1
  493.  
  494.   SetOutPath $INSTDIR\Plugins
  495.   File ..\Plugins\nsExec.dll
  496.   SetOutPath $INSTDIR\Docs\nsExec
  497.   File ..\Docs\nsExec\nsExec.txt
  498.   SetOutPath $INSTDIR\Examples\nsExec
  499.   File ..\Examples\nsExec\test.nsi
  500. ${MementoSectionEnd}
  501.  
  502. ${MementoSection} "Splash" SecPluginsSplash
  503.  
  504.   SetDetailsPrint textonly
  505.   DetailPrint "Installing Plug-ins | Splash..."
  506.   SetDetailsPrint listonly
  507.  
  508.   SectionIn 1
  509.  
  510.   SetOutPath $INSTDIR\Plugins
  511.   File ..\Plugins\splash.dll
  512.   SetOutPath $INSTDIR\Docs\Splash
  513.   File ..\Docs\Splash\splash.txt
  514.   SetOutPath $INSTDIR\Examples\Splash
  515.   File ..\Examples\Splash\Example.nsi
  516. ${MementoSectionEnd}
  517.  
  518. ${MementoSection} "AdvSplash" SecPluginsSplashT
  519.  
  520.   SetDetailsPrint textonly
  521.   DetailPrint "Installing Plug-ins | AdvSplash..."
  522.   SetDetailsPrint listonly
  523.  
  524.   SectionIn 1
  525.  
  526.   SetOutPath $INSTDIR\Plugins
  527.   File ..\Plugins\advsplash.dll
  528.   SetOutPath $INSTDIR\Docs\AdvSplash
  529.   File ..\Docs\AdvSplash\advsplash.txt
  530.   SetOutPath $INSTDIR\Examples\AdvSplash
  531.   File ..\Examples\AdvSplash\Example.nsi
  532. ${MementoSectionEnd}
  533.  
  534. ${MementoSection} "BgImage" SecPluginsBgImage
  535.  
  536.   SetDetailsPrint textonly
  537.   DetailPrint "Installing Plug-ins | BgImage..."
  538.   SetDetailsPrint listonly
  539.  
  540.   SectionIn 1
  541.  
  542.   SetOutPath $INSTDIR\Plugins
  543.   File ..\Plugins\BgImage.dll
  544.   SetOutPath $INSTDIR\Docs\BgImage
  545.   File ..\Docs\BgImage\BgImage.txt
  546.   SetOutPath $INSTDIR\Examples\BgImage
  547.   File ..\Examples\BgImage\Example.nsi
  548. ${MementoSectionEnd}
  549.  
  550. ${MementoSection} "InstallOptions" SecPluginsIO
  551.  
  552.   SetDetailsPrint textonly
  553.   DetailPrint "Installing Plug-ins | InstallOptions..."
  554.   SetDetailsPrint listonly
  555.  
  556.   SectionIn 1
  557.  
  558.   SetOutPath $INSTDIR\Plugins
  559.   File ..\Plugins\InstallOptions.dll
  560.   SetOutPath $INSTDIR\Docs\InstallOptions
  561.   File ..\Docs\InstallOptions\Readme.html
  562.   File ..\Docs\InstallOptions\Changelog.txt
  563.   SetOutPath $INSTDIR\Examples\InstallOptions
  564.   File ..\Examples\InstallOptions\test.ini
  565.   File ..\Examples\InstallOptions\test.nsi
  566.   File ..\Examples\InstallOptions\testimgs.ini
  567.   File ..\Examples\InstallOptions\testimgs.nsi
  568.   File ..\Examples\InstallOptions\testlink.ini
  569.   File ..\Examples\InstallOptions\testlink.nsi
  570.   File ..\Examples\InstallOptions\testnotify.ini
  571.   File ..\Examples\InstallOptions\testnotify.nsi
  572. ${MementoSectionEnd}
  573.  
  574. ${MementoSection} "nsDialogs" SecPluginsDialogs
  575.  
  576.   SetDetailsPrint textonly
  577.   DetailPrint "Installing Plug-ins | nsDialogs..."
  578.   SetDetailsPrint listonly
  579.  
  580.   SectionIn 1
  581.  
  582.   SetOutPath $INSTDIR\Plugins
  583.   File ..\Plugins\nsDialogs.dll
  584.   SetOutPath $INSTDIR\Examples\nsDialogs
  585.   File ..\Examples\nsDialogs\example.nsi
  586.   File ..\Examples\nsDialogs\InstallOptions.nsi
  587.   File ..\Examples\nsDialogs\welcome.nsi
  588.   SetOutPath $INSTDIR\Include
  589.   File ..\Include\nsDialogs.nsh
  590.   SetOutPath $INSTDIR\Docs\nsDialogs
  591.   File ..\Docs\nsDialogs\Readme.html
  592. ${MementoSectionEnd}
  593.  
  594. ${MementoSection} "Math" SecPluginsMath
  595.  
  596.   SetDetailsPrint textonly
  597.   DetailPrint "Installing Plug-ins | Math..."
  598.   SetDetailsPrint listonly
  599.  
  600.   SectionIn 1
  601.  
  602.   SetOutPath $INSTDIR\Plugins
  603.   File ..\Plugins\Math.dll
  604.   SetOutPath $INSTDIR\Docs\Math
  605.   File ..\Docs\Math\Math.txt
  606.   SetOutPath $INSTDIR\Examples\Math
  607.   File ..\Examples\Math\math.nsi
  608.   File ..\Examples\Math\mathtest.txt
  609.   File ..\Examples\Math\mathtest.nsi
  610.   File ..\Examples\Math\mathtest.ini
  611.  
  612. ${MementoSectionEnd}
  613.  
  614. ${MementoSection} "NSISdl" SecPluginsNSISDL
  615.  
  616.   SetDetailsPrint textonly
  617.   DetailPrint "Installing Plug-ins | NSISdl..."
  618.   SetDetailsPrint listonly
  619.  
  620.   SectionIn 1
  621.  
  622.   SetOutPath $INSTDIR\Plugins
  623.   File ..\Plugins\nsisdl.dll
  624.   SetOutPath $INSTDIR\Docs\NSISdl
  625.   File ..\Docs\NSISdl\ReadMe.txt
  626.   File ..\Docs\NSISdl\License.txt
  627. ${MementoSectionEnd}
  628.  
  629. ${MementoSection} "System" SecPluginsSystem
  630.  
  631.   SetDetailsPrint textonly
  632.   DetailPrint "Installing Plug-ins | System..."
  633.   SetDetailsPrint listonly
  634.  
  635.   SectionIn 1
  636.  
  637.   SetOutPath $INSTDIR\Plugins
  638.   File ..\Plugins\System.dll
  639.   SetOutPath $INSTDIR\Docs\System
  640.   File ..\Docs\System\System.html
  641.   File ..\Docs\System\WhatsNew.txt
  642.   SetOutPath $INSTDIR\Examples\System
  643.   File ..\Examples\System\Resource.dll
  644.   File ..\Examples\System\SysFunc.nsh
  645.   File ..\Examples\System\System.nsh
  646.   File ..\Examples\System\System.nsi
  647. ${MementoSectionEnd}
  648.  
  649. ${MementoSection} "StartMenu" SecPluginsStartMenu
  650.  
  651.   SetDetailsPrint textonly
  652.   DetailPrint "Installing Plug-ins | StartMenu..."
  653.   SetDetailsPrint listonly
  654.  
  655.   SectionIn 1
  656.  
  657.   SetOutPath $INSTDIR\Plugins
  658.   File ..\Plugins\StartMenu.dll
  659.   SetOutPath $INSTDIR\Docs\StartMenu
  660.   File ..\Docs\StartMenu\Readme.txt
  661.   SetOutPath $INSTDIR\Examples\StartMenu
  662.   File ..\Examples\StartMenu\Example.nsi
  663. ${MementoSectionEnd}
  664.  
  665. ${MementoSection} "UserInfo" SecPluginsUserInfo
  666.  
  667.   SetDetailsPrint textonly
  668.   DetailPrint "Installing Plug-ins | UserInfo..."
  669.   SetDetailsPrint listonly
  670.  
  671.   SectionIn 1
  672.  
  673.   SetOutPath $INSTDIR\Plugins
  674.   File ..\Plugins\UserInfo.dll
  675.   SetOutPath $INSTDIR\Examples\UserInfo
  676.   File ..\Examples\UserInfo\UserInfo.nsi
  677. ${MementoSectionEnd}
  678.  
  679. ${MementoSection} "Dialer" SecPluginsDialer
  680.  
  681.   SetDetailsPrint textonly
  682.   DetailPrint "Installing Plug-ins | Dialer..."
  683.   SetDetailsPrint listonly
  684.  
  685.   SectionIn 1
  686.  
  687.   SetOutPath $INSTDIR\Plugins
  688.   File ..\Plugins\Dialer.dll
  689.   SetOutPath $INSTDIR\Docs\Dialer
  690.   File ..\Docs\Dialer\Dialer.txt
  691. ${MementoSectionEnd}
  692.  
  693. ${MementoSection} "VPatch" SecPluginsVPatch
  694.  
  695.   SetDetailsPrint textonly
  696.   DetailPrint "Installing Plug-ins | VPatch..."
  697.   SetDetailsPrint listonly
  698.  
  699.   SectionIn 1
  700.  
  701.   SetOutPath $INSTDIR\Plugins
  702.   File ..\Plugins\VPatch.dll
  703.   SetOutPath $INSTDIR\Examples\VPatch
  704.   File ..\Examples\VPatch\example.nsi
  705.   File ..\Examples\VPatch\oldfile.txt
  706.   File ..\Examples\VPatch\newfile.txt
  707.   File ..\Examples\VPatch\patch.pat
  708.   SetOutPath $INSTDIR\Docs\VPatch
  709.   File ..\Docs\VPatch\Readme.html
  710.   SetOutPath $INSTDIR\Bin
  711.   File ..\Bin\GenPat.exe
  712.   SetOutPath $INSTDIR\Include
  713.   File ..\Include\VPatchLib.nsh
  714. ${MementoSectionEnd}
  715.  
  716. ${MementoSectionDone}
  717.  
  718. SectionGroupEnd
  719.  
  720. Section -post
  721.  
  722.   ; When Modern UI is installed:
  723.   ; * Always install the English language file
  724.   ; * Always install default icons / bitmaps
  725.  
  726.   !insertmacro SectionFlagIsSet ${SecInterfacesModernUI} ${SF_SELECTED} mui nomui
  727.  
  728.     mui:
  729.  
  730.     SetDetailsPrint textonly
  731.     DetailPrint "Configuring Modern UI..."
  732.     SetDetailsPrint listonly
  733.  
  734.     !insertmacro SectionFlagIsSet ${SecLangFiles} ${SF_SELECTED} langfiles nolangfiles
  735.  
  736.       nolangfiles:
  737.  
  738.       SetOutPath "$INSTDIR\Contrib\Language files"
  739.       File "..\Contrib\Language files\English.nlf"
  740.       SetOutPath "$INSTDIR\Contrib\Language files"
  741.       File "..\Contrib\Language files\English.nsh"
  742.  
  743.     langfiles:
  744.  
  745.     !insertmacro SectionFlagIsSet ${SecGraphics} ${SF_SELECTED} graphics nographics
  746.  
  747.       nographics:
  748.  
  749.       SetOutPath $INSTDIR\Contrib\Graphics
  750.       SetOutPath $INSTDIR\Contrib\Graphics\Checks
  751.       File "..\Contrib\Graphics\Checks\modern.bmp"
  752.       SetOutPath $INSTDIR\Contrib\Graphics\Icons
  753.       File "..\Contrib\Graphics\Icons\modern-install.ico"
  754.       File "..\Contrib\Graphics\Icons\modern-uninstall.ico"
  755.       SetOutPath $INSTDIR\Contrib\Graphics\Header
  756.       File "..\Contrib\Graphics\Header\nsis.bmp"
  757.       SetOutPath $INSTDIR\Contrib\Graphics\Wizard
  758.       File "..\Contrib\Graphics\Wizard\win.bmp"
  759.  
  760.     graphics:
  761.  
  762.   nomui:
  763.  
  764.   SetDetailsPrint textonly
  765.   DetailPrint "Creating Registry Keys..."
  766.   SetDetailsPrint listonly
  767.  
  768.   SetOutPath $INSTDIR
  769.  
  770.   WriteRegStr HKLM "Software\NSIS" "" $INSTDIR
  771. !ifdef VER_MAJOR & VER_MINOR & VER_REVISION & VER_BUILD
  772.   WriteRegDword HKLM "Software\NSIS" "VersionMajor" "${VER_MAJOR}"
  773.   WriteRegDword HKLM "Software\NSIS" "VersionMinor" "${VER_MINOR}"
  774.   WriteRegDword HKLM "Software\NSIS" "VersionRevision" "${VER_REVISION}"
  775.   WriteRegDword HKLM "Software\NSIS" "VersionBuild" "${VER_BUILD}"
  776. !endif
  777.  
  778.   WriteRegExpandStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NSIS" "UninstallString" '"$INSTDIR\uninst-nsis.exe"'
  779.   WriteRegExpandStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NSIS" "InstallLocation" "$INSTDIR"
  780.   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NSIS" "DisplayName" "Nullsoft Install System"
  781.   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NSIS" "DisplayIcon" "$INSTDIR\NSIS.exe,0"
  782.   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NSIS" "DisplayVersion" "${VERSION}"
  783. !ifdef VER_MAJOR & VER_MINOR & VER_REVISION & VER_BUILD
  784.   WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NSIS" "VersionMajor" "${VER_MAJOR}"
  785.   WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NSIS" "VersionMinor" "${VER_MINOR}.${VER_REVISION}"
  786. !endif
  787.   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NSIS" "URLInfoAbout" "http://nsis.sourceforge.net/"
  788.   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NSIS" "HelpLink" "http://nsis.sourceforge.net/Support"
  789.   WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NSIS" "NoModify" "1"
  790.   WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NSIS" "NoRepair" "1"
  791.  
  792.   WriteUninstaller $INSTDIR\uninst-nsis.exe
  793.  
  794.   ${MementoSectionSave}
  795.  
  796.   SetDetailsPrint both
  797.  
  798. SectionEnd
  799.  
  800. ;--------------------------------
  801. ;Descriptions
  802.  
  803. !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
  804.   !insertmacro MUI_DESCRIPTION_TEXT ${SecCore} "The core files required to use NSIS (compiler etc.)"
  805.   !insertmacro MUI_DESCRIPTION_TEXT ${SecExample} "Example installation scripts that show you how to use NSIS"
  806.   !insertmacro MUI_DESCRIPTION_TEXT ${SecShortcuts} "Adds icons to your start menu and your desktop for easy access"
  807.   !insertmacro MUI_DESCRIPTION_TEXT ${SecInterfaces} "User interface designs that can be used to change the installer look and feel"
  808.   !insertmacro MUI_DESCRIPTION_TEXT ${SecInterfacesModernUI} "A modern user interface like the wizards of recent Windows versions"
  809.   !insertmacro MUI_DESCRIPTION_TEXT ${SecInterfacesDefaultUI} "The default NSIS user interface which you can customize to make your own UI"
  810.   !insertmacro MUI_DESCRIPTION_TEXT ${SecInterfacesTinyUI} "A tiny version of the default user interface"
  811.   !insertmacro MUI_DESCRIPTION_TEXT ${SecTools} "Tools that help you with NSIS development"
  812.   !insertmacro MUI_DESCRIPTION_TEXT ${SecToolsZ2E} "A utility that converts a ZIP file to a NSIS installer"
  813.   !insertmacro MUI_DESCRIPTION_TEXT ${SecGraphics} "Icons, checkbox images and other graphics"
  814.   !insertmacro MUI_DESCRIPTION_TEXT ${SecLangFiles} "Language files used to support multiple languages in an installer"
  815.   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsPlugins} "Useful plugins that extend NSIS's functionality"
  816.   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsBanner} "Plugin that lets you show a banner before installation starts"
  817.   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsLangDLL} "Plugin that lets you add a language select dialog to your installer"
  818.   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsnsExec} "Plugin that executes console programs and prints its output in the NSIS log window or hides it"
  819.   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsSplash} "Splash screen add-on that lets you add a splash screen to an installer"
  820.   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsSplashT} "Splash screen add-on with transparency support that lets you add a splash screen to an installer"
  821.   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsSystem} "Plugin that lets you call Win32 API or external DLLs"
  822.   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsMath} "Plugin that lets you evaluate complicated mathematical expressions"
  823.   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsDialer} "Plugin that provides internet connection functions"
  824.   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsIO} "Plugin that lets you add custom pages to an installer"
  825.   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsDialogs} "Plugin that lets you add custom pages to an installer"
  826.   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsStartMenu} "Plugin that lets the user select the start menu folder"
  827.   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsBgImage} "Plugin that lets you show a persistent background image plugin and play sounds"
  828.   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsUserInfo} "Plugin that that gives you the user name and the user account type"
  829.   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsNSISDL} "Plugin that lets you create a web based installer"
  830.   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsVPatch} "Plugin that lets you create patches to upgrade older files"
  831. !insertmacro MUI_FUNCTION_DESCRIPTION_END
  832.  
  833. ;--------------------------------
  834. ;Installer Functions
  835.  
  836. Function .onInit
  837.  
  838.   ${MementoSectionRestore}
  839.  
  840. FunctionEnd
  841.  
  842. !ifdef VER_MAJOR & VER_MINOR & VER_REVISION & VER_BUILD
  843.  
  844. Var ReinstallPageCheck
  845.  
  846. Function PageReinstall
  847.  
  848.   ReadRegStr $R0 HKLM "Software\NSIS" ""
  849.  
  850.   ${If} $R0 == ""
  851.     Abort
  852.   ${EndIf}
  853.  
  854.   ReadRegDWORD $R0 HKLM "Software\NSIS" "VersionMajor"
  855.   ReadRegDWORD $R1 HKLM "Software\NSIS" "VersionMinor"
  856.   ReadRegDWORD $R2 HKLM "Software\NSIS" "VersionRevision"
  857.   ReadRegDWORD $R3 HKLM "Software\NSIS" "VersionBuild"
  858.   StrCpy $R0 $R0.$R1.$R2.$R3
  859.  
  860.   ${VersionCompare} ${VER_MAJOR}.${VER_MINOR}.${VER_REVISION}.${VER_BUILD} $R0 $R0
  861.   ${If} $R0 == 0
  862.     StrCpy $R1 "NSIS ${VERSION} is already installed. Select the operation you want to perform and click Next to continue."
  863.     StrCpy $R2 "Add/Reinstall components"
  864.     StrCpy $R3 "Uninstall NSIS"
  865.     !insertmacro MUI_HEADER_TEXT "Already Installed" "Choose the maintenance option to perform."
  866.     StrCpy $R0 "2"
  867.   ${ElseIf} $R0 == 1
  868.     StrCpy $R1 "An older version of NSIS is installed on your system. It's recommended that you uninstall the current version before installing. Select the operation you want to perform and click Next to continue."
  869.     StrCpy $R2 "Uninstall before installing"
  870.     StrCpy $R3 "Do not uninstall"
  871.     !insertmacro MUI_HEADER_TEXT "Already Installed" "Choose how you want to install NSIS."
  872.     StrCpy $R0 "1"
  873.   ${ElseIf} $R0 == 2
  874.     StrCpy $R1 "A newer version of NSIS is already installed! It is not recommended that you install an older version. If you really want to install this older version, it's better to uninstall the current version first. Select the operation you want to perform and click Next to continue."
  875.     StrCpy $R2 "Uninstall before installing"
  876.     StrCpy $R3 "Do not uninstall"
  877.     !insertmacro MUI_HEADER_TEXT "Already Installed" "Choose how you want to install NSIS."
  878.     StrCpy $R0 "1"
  879.   ${Else}
  880.     Abort
  881.   ${EndIf}
  882.  
  883.   nsDialogs::Create /NOUNLOAD 1018
  884.   Pop $R4
  885.  
  886.   ${NSD_CreateLabel} 0 0 100% 24u $R1
  887.   Pop $R1
  888.  
  889.   ${NSD_CreateRadioButton} 30u 50u -30u 8u $R2
  890.   Pop $R2
  891.   ${NSD_OnClick} $R2 PageReinstallUpdateSelection
  892.  
  893.   ${NSD_CreateRadioButton} 30u 70u -30u 8u $R3
  894.   Pop $R3
  895.   ${NSD_OnClick} $R3 PageReinstallUpdateSelection
  896.  
  897.   ${If} $ReinstallPageCheck != 2
  898.     SendMessage $R2 ${BM_SETCHECK} ${BST_CHECKED} 0
  899.   ${Else}
  900.     SendMessage $R3 ${BM_SETCHECK} ${BST_CHECKED} 0
  901.   ${EndIf}
  902.  
  903.   nsDialogs::Show
  904.  
  905. FunctionEnd
  906.  
  907. Function PageReinstallUpdateSelection
  908.  
  909.   Pop $R1
  910.  
  911.   ${NSD_GetState} $R2 $R1
  912.  
  913.   ${If} $R1 == ${BST_CHECKED}
  914.     StrCpy $ReinstallPageCheck 1
  915.   ${Else}
  916.     StrCpy $ReinstallPageCheck 2
  917.   ${EndIf}
  918.  
  919. FunctionEnd
  920.  
  921. Function PageLeaveReinstall
  922.  
  923.   ${NSD_GetState} $R2 $R1
  924.  
  925.   StrCmp $R0 "1" 0 +2
  926.     StrCmp $R1 "1" reinst_uninstall reinst_done
  927.  
  928.   StrCmp $R0 "2" 0 +3
  929.     StrCmp $R1 "1" reinst_done reinst_uninstall
  930.  
  931.   reinst_uninstall:
  932.   ReadRegStr $R1 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NSIS" "UninstallString"
  933.  
  934.   ;Run uninstaller
  935.   HideWindow
  936.  
  937.     ClearErrors
  938.     ExecWait '$R1 _?=$INSTDIR'
  939.  
  940.     IfErrors no_remove_uninstaller
  941.     IfFileExists "$INSTDIR\makensis.exe" no_remove_uninstaller
  942.  
  943.       Delete $R1
  944.       RMDir $INSTDIR
  945.  
  946.     no_remove_uninstaller:
  947.  
  948.   StrCmp $R0 "2" 0 +2
  949.     Quit
  950.  
  951.   BringToFront
  952.  
  953.   reinst_done:
  954.  
  955. FunctionEnd
  956.  
  957. !endif # VER_MAJOR & VER_MINOR & VER_REVISION & VER_BUILD
  958.  
  959. Function ShowReleaseNotes
  960.   ${If} ${FileExists} $WINDIR\hh.exe
  961.     StrCpy $0 $WINDIR\hh.exe
  962.     Exec '"$0" mk:@MSITStore:$INSTDIR\NSIS.chm::/SectionF.1.html'
  963.   ${Else}
  964.     SearchPath $0 hh.exe
  965.     ${If} ${FileExists} $0
  966.       Exec '"$0" mk:@MSITStore:$INSTDIR\NSIS.chm::/SectionF.1.html'
  967.     ${Else}
  968.       ExecShell "open" "http://nsis.sourceforge.net/Docs/AppendixF.html#F.1"
  969.     ${EndIf}
  970.   ${EndIf}
  971. FunctionEnd
  972.  
  973. ;--------------------------------
  974. ;Uninstaller Section
  975.  
  976. Section Uninstall
  977.  
  978.   SetDetailsPrint textonly
  979.   DetailPrint "Uninstalling NSI Development Shell Extensions..."
  980.   SetDetailsPrint listonly
  981.  
  982.   IfFileExists $INSTDIR\makensis.exe nsis_installed
  983.     MessageBox MB_YESNO "It does not appear that NSIS is installed in the directory '$INSTDIR'.$\r$\nContinue anyway (not recommended)?" IDYES nsis_installed
  984.     Abort "Uninstall aborted by user"
  985.   nsis_installed:
  986.  
  987.   SetDetailsPrint textonly
  988.   DetailPrint "Deleting Registry Keys..."
  989.   SetDetailsPrint listonly
  990.  
  991.   ReadRegStr $R0 HKCR ".nsi" ""
  992.   StrCmp $R0 "NSIS.Script" 0 +2
  993.     DeleteRegKey HKCR ".nsi"
  994.  
  995.   ReadRegStr $R0 HKCR ".nsh" ""
  996.   StrCmp $R0 "NSIS.Header" 0 +2
  997.     DeleteRegKey HKCR ".nsh"
  998.  
  999.   DeleteRegKey HKCR "NSIS.Script"
  1000.   DeleteRegKey HKCR "NSIS.Header"
  1001.  
  1002.   System::Call 'Shell32::SHChangeNotify(i ${SHCNE_ASSOCCHANGED}, i ${SHCNF_IDLIST}, i 0, i 0)'
  1003.  
  1004.   DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NSIS"
  1005.   DeleteRegKey HKLM "Software\NSIS"
  1006.  
  1007.   SetDetailsPrint textonly
  1008.   DetailPrint "Deleting Files..."
  1009.   SetDetailsPrint listonly
  1010.  
  1011.   Delete $SMPROGRAMS\NSIS.lnk
  1012.   Delete $DESKTOP\NSIS.lnk
  1013.   Delete $INSTDIR\makensis.exe
  1014.   Delete $INSTDIR\makensisw.exe
  1015.   Delete $INSTDIR\NSIS.exe
  1016.   Delete $INSTDIR\license.txt
  1017.   Delete $INSTDIR\COPYING
  1018.   Delete $INSTDIR\uninst-nsis.exe
  1019.   Delete $INSTDIR\nsisconf.nsi
  1020.   Delete $INSTDIR\nsisconf.nsh
  1021.   Delete $INSTDIR\NSIS.chm
  1022.   RMDir /r $INSTDIR\Bin
  1023.   RMDir /r $INSTDIR\Contrib
  1024.   RMDir /r $INSTDIR\Docs
  1025.   RMDir /r $INSTDIR\Examples
  1026.   RMDir /r $INSTDIR\Include
  1027.   RMDir /r $INSTDIR\Menu
  1028.   RMDir /r $INSTDIR\Plugins
  1029.   RMDir /r $INSTDIR\Stubs
  1030.   RMDir $INSTDIR
  1031.  
  1032.   SetDetailsPrint both
  1033.  
  1034. SectionEnd
  1035.